// BUSYBOX MD5 code, repurposed for the function in SlideScript
// Licensing and contributions to the BusyBox development team, changes
// and cleanup done by Bob (OldCoder) Kiraly, 2022

/*
    SlideScript - minimalistic top-down scripting language.
    (C) Copyright 2014-2022 Chris Dorman - some rights reserved (GPLv2)

    View README file supplied with this software for more details
*/

typedef unsigned char  uint8_md5;
typedef unsigned short uint16_md5;
typedef unsigned int   uint32_md5;
typedef unsigned long  uint64_md5;

typedef struct md5_ctx_md5
{
    uint8_md5  wbuffer [64];
    void (*process_block) (struct md5_ctx_md5 *);
    uint64_md5 total64;
    uint32_md5 hash [8];
}
    md5_ctx_t;

void         md5_begin (md5_ctx_t *ctx);
void         md5_hash  (md5_ctx_t *ctx, const void *buffer, size_t len);
unsigned int md5_end   (md5_ctx_t *ctx, void *resbuf);

extern char *md5_data   (char *buf, int len);
extern char *md5_file   (char *ifname);
extern char *md5_string (char *string);
